Test Failed
Push — master ( 1271ab...04a38e )
by Dmytro
03:35 queued 11s
created

utils.js ➔ axiosError   A

Complexity

Conditions 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
1
import API_ERROR from 'base-api-client/lib/Error';
2
3
export function axiosResponse(data) {
4
    return { data: { result: data } };
5
}
6
7
export function axiosError(message, data) {
8
    const err = new Error(message);
9
10
    err.response = { data };
11
12
    return new API_ERROR(err);
13
}
14